<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../css/mui.css" rel="stylesheet" />
		<link href="css/header.css" rel="stylesheet" />
		<style>
			.mui-table-view{
				margin-top: 3.125rem;
			}
		</style>
	</head>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			
			<h1 class="mui-title">教练详情</h1>
		</header>
		<ul class="mui-table-view">
			<li class="mui-table-view-cell mui-media">
				<a href="javascript:;">
					<img class="mui-media-object mui-pull-right" src="../image/default.jpg" id="coach_photo">
					<div class="mui-media-body">
						<span id="coach_name">李达</span>
						<p class="mui-ellipsis" id="coach_slogan">个性签名：为会员指导健身</p>
					</div>
				</a>
			</li>
		</ul>
		<ul class="mui-table-view">
				<li class="mui-table-view-cell">
					年龄
					<span id="span_age" class="mui-pull-right" 
							style="color: royalblue;font-size: 14px;">173</span>
				</li>
				<li class="mui-table-view-cell">
					身高
					<span id="span_height" class="mui-pull-right" 
							style="color: royalblue;font-size: 14px;">173</span>
				</li>
				<li class="mui-table-view-cell">
					体重
					<span id="span_weight" class="mui-pull-right" 
							style="color: royalblue;font-size: 14px;">173</span>
				</li>
				<li class="mui-table-view-cell">
					擅长
					<span id="span_able" class="mui-pull-right" 
							style="color: royalblue;font-size: 14px;">173</span>
				</li>
				<li class="mui-table-view-cell">
					教龄
					<span id="span_tyear" class="mui-pull-right" 
							style="color: royalblue;font-size: 14px;">173</span>
				</li>
			</ul>
	<body>
		<script src="../js/mui.js"></script>
		<script src="../js/app.js"></script>
		<script type="text/javascript">
			mui.init()
			mui.plusReady(function () {
				var self = plus.webview.currentWebview();
				var cid = self.cid;
				mui.ajax(app.serverUrl+'/user/readCoachinfo',{
					data:{
						cid:cid
					},
					dataType:'json',//服务器返回json格式数据
					type:'post',//HTTP请求类型
					timeout:10000,//超时时间设置为10秒；
					success:function(data){
						console.log(JSON.stringify(data));
						readinfo(data.data);
						
					},
					error:function(xhr,type,errorThrown){
						
					}
				});
			   
			});
			function readinfo(data){
				var coach_photo = document.getElementById("coach_photo");
				var coach_name = document.getElementById("coach_name");
				var coach_slogan = document.getElementById("coach_slogan");
				var span_age = document.getElementById("span_age");
				var span_height = document.getElementById("span_height");
				var span_weight = document.getElementById("span_weight");
				var span_able = document.getElementById("span_able");
				var span_tyear = document.getElementById("span_tyear");
				coach_photo.src =app.serverUrl + data.picture;
				coach_name.innerHTML = data.name;
				coach_slogan.innerHTML = data.slogan;
				span_age.innerHTML = data.age;
				span_height.innerHTML = data.height;
				span_able.innerHTML = data.able;
				span_tyear.innerHTML = data.tyear;
				span_weight.innerHTML = data.weight;
			}
		</script>
	</body>

</html>
